package com.example.springsecurity.exception;

import lombok.Data;

/**
 * @author wuancheng
 * @date 2024/6/21 9:35
 * @description 自定义异常
 */
@Data
public class MySecurityException extends RuntimeException{
    private String errorDesc;
    private String errorCode;

    public MySecurityException(String errorCode, String errorDesc) {
        this(errorDesc, false);
        this.errorCode = errorCode;
        this.errorDesc = errorDesc;
    }

    public MySecurityException(String message, boolean recordStackTrace) {
        super(message, null, false, recordStackTrace);
    }

    public MySecurityException(String errorCode, String errorDesc, Throwable cause) {
        super(errorDesc, cause, false, true);
        this.errorCode = errorCode;
        this.errorDesc = errorDesc;
    }
}
